package com.nansu.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class MyController3 {


    @RequestMapping("/getSession")
    public String getInfo(@RequestHeader("User-Agent") String userAgent, @CookieValue("JSESSIONID") String jSessionId){
        System.out.println(userAgent);
        System.out.println(jSessionId);
        return "info";
    }


    @RequestMapping("/getModelMap")
    public String setModelMap(ModelMap modelMap){
        modelMap.addAttribute("name","南苏和黄非凡");
        return "info";
    }

}
